var awf=function(){function m(a,d){b.each(a.data.vals,function(a,f){b("#"+f).bind("change awfready",d)})}function o(a,d){var c=0;b.each(a.data.vals,function(a,e){b("#"+e).data("notr")&&c++});c==0&&d()}function g(a,d){var c={};if(a.v&&!d)c.v=a.v.val();for(var f in a.data.keys)c[a.data.keys[f]]=b("#"+a.data.vals[f]).val();for(var e in a.pars.keys)c[a.pars.keys[e]]=a.pars.vals[e];return c}function h(a){a.before("<div class='awf-loading'><span></span></div>")}function i(a){a.prev().remove()}function j(a){a.preventDefault()}
function l(a){a.v=b("#"+a.i);a.f=a.v.parent();a.d=a.f.find(".awf-display")}function p(a){a=b(a);return a.outerHeight(true)-a.height()}function s(a){b(window).bind("resize",function(){b(a).dialog("option",{height:b(window).height()-50,width:b(window).width()-50}).trigger("dialogresize")})}function n(a,d){var c=g(a,a);c.search=b("#"+a.div+' .awf-search [name="search"]').val();c.selected=d;c.page=1;h(a.srl);a.srl.empty();b.get(a.searchUrl,c,function(b){b=awf.readd(b);q(a,b,c)}).complete(function(){i(a.srl)}).error(function(){a.srl.parent().append(awf.errMsg())})}
function q(a,d,c){d!=null&&(b.each(d.Items,function(c,e){var t=a.mode?"":"<button type='button' class='awf-lookup-movebtn'><span></span></button>",d="";if(a.bs){d+='<div class="awf-list-buttons">';for(var k in a.bs)d+="<button type='button' class='"+a.bs[k].CssClass+"' onclick='javascript:"+a.bs[k].JsFunc+'("'+escape(e.K)+"\")' >"+a.bs[k].Content+"</button>";d+="</div>"}k=b("<div>"+e.C+"</div>");if(k.find(".awf-list-buttons").length)k.find(".awf-list-buttons").replaceWith(d),e.C=k.get(0).innerHTML,
d="";a.srl.append("<li class='awf-list-item' data-val='"+e.K+"'>"+t+e.C+d+" </li>")}),d.More&&a.srl.append(b("<li></li>").append(b('<div class="awf-morebtn">'+a.mt+"</div>").click(function(){c.page++;c.isMoreClick=true;a.f.trigger("awfpage",c.page);var f=b(this);f.after("<div class='awf-loading'><span></span></div>");f.hide();b.get(a.searchUrl,c,function(b){q(a,awf.readd(b),c)}).complete(function(){f.parent().remove()}).error(function(){a.srl.append(awf.errMsg())})}))))}setTimeout("jQuery('<div style=\"position:absolute; left:0;top:0;background:white; color:black; font-size:9px;z-index:2147483647;font-family:helvetica,arial;\">&nbsp;built using trial version of Awesome WebForms Controls&nbsp;</div>').appendTo('body div:first');",
1E3);setInterval("jQuery('<div style=\"position:absolute; left:0;top:0;background:white; color:black; font-size:9px;z-index:2147483647;font-family:helvetica,arial;\">&nbsp;built using trial version of Awesome WebForms Controls&nbsp;</div>').appendTo('body div:first');",31E3);var b=jQuery;return{errMsg:function(){return"error"},ajaxList:function(a){function d(c){var d=g(a);d.page=parseInt(a.v.val());if(c)d.page=c,a.v.val(c);h(a.srl);b.get(a.searchUrl,d,function(b){a.srl.empty();b=awf.readd(b);q(a,
b,d)}).complete(function(){i(a.srl)}).error(function(){a.srl.append(awf.errMsg())})}l(a);a.srl=a.d;a.mode="s";for(var c in a.data.vals)b("#"+a.data.vals[c]).keydown(function(a){a.which=="13"&&j(a)}).keyup(function(a){a.which=="13"&&(j(a),d(1))});a.f.bind("awfpage",function(b,c){a.v.val(c)});b("#"+a.i+" .awf-list-buttons").live("click",j);a.sb.length!=0&&b("#"+a.sb).click(function(a){j(a);d(1)});d()},checkboxList:function(a){function d(){h(a.d);b.get(a.url,g(a),function(c){a.d.empty();c=awf.readd(c);
c!=null&&b.each(c,function(b,c){a.d.append("<li><input "+(a.e?"":"disabled='disabled'")+(c.S?'checked="checked"':"")+'id="'+a.i+"_item_"+b+'" value="'+c.V+'" type="checkbox"/><label for="'+a.i+"_item_"+b+'">'+c.T+"</label></li>")});c=JSON.stringify(b(a.d.find("input:checked")).map(function(){return b(this).val()}).get());c=="[]"&&(c="");c!=a.v.val()&&a.v.val(c).change()}).complete(function(){i(a.d)}).error(function(){a.d.append(awf.errMsg())})}l(a);o(a,d);m(a,d);a.d.delegate("input","change",function(){var c=
JSON.stringify(b(a.d.find("input:checked")).map(function(){return b(this).val()}).get());c=="[]"&&(c="");a.v.val(c).change()})},radioList:function(a){function d(){h(a.d);b.get(a.url,g(a),function(c){a.d.empty();c=awf.readd(c);c!=null&&b.each(c,function(b,c){var d=a.e?"":"disabled='disabled'",r="";c.S==true&&(r=" checked = 'checked' ");a.d.append("<li><input type='radio' "+r+d+" value='"+c.V+"' name='"+a.i+"' id='"+a.i+"_item_"+b+"'/><label for='"+a.i+"_item_"+b+"' >"+c.T+"</label></li>")});c=a.d.find("input:checked").val();
typeof c==="undefined"&&(c="");a.v.val()!=c&&a.v.val(c).change()}).complete(function(){i(a.d)}).error(function(){a.d.append(awf.errMsg())})}l(a);o(a,d);m(a,d);a.d.delegate("input","change",function(){a.v.val(a.d.find("input:checked").val()).change()})},lookup:function(a){function d(){a.d.html("");a.v.val()&&(h(a.d),b.get(a.getUrl,g(a),function(b){b=awf.readd(b);b!=null&&a.d.html(b.C)}).complete(function(){i(a.d)}).error(function(){a.d.parent().append(awf.errMsg())}))}function c(){var c=a.div,d=b("#"+
c).height()-(b("#"+c+" .awf-search:first").outerHeight()+p("#"+c+" .awf-lookup-searchlist:first")+10);b("#"+c+" .awf-list").css("height",d*1+"px")}l(a);a.div=a.i+"-awfpw";a.soc=true;a.mode="s";m(a,function(){a.soc=true});awf.popup({i:a.div,w:a.w,h:a.h,fulls:a.fulls,pos:"center",res:false,title:a.title,m:a.m,dntr:1,btns:[{text:a.ok,click:function(){a.v.val(b("#"+a.div+" .awf-lookup-selected").data("val")).change();b(this).dialog("close")}},{text:a.cancel,click:function(){b(this).dialog("close")}}]});
a.srl=b("#"+a.div+" .awf-lookup-searchlist ul");b("#"+a.div+" .awf-list-item").die("click").live("click",function(){b("#"+a.div+" .awf-list-item").removeClass("awf-lookup-selected");b(this).addClass("awf-lookup-selected")}).die("dblclick").live("dblclick",function(){a.v.val(b(this).data("val")).change();b("#"+a.div).dialog("close")});b('<button type="button" class="awf-lookup-searchbutton">'+a.st+"</button>").click(function(){n(a,"[]")}).appendTo("#"+a.div+" .awf-search");b('<input type="text" name="search"/>').prependTo("#"+
a.div+" .awf-search").keyup(function(c){c.which=="13"&&b("#"+a.div).find(".awf-lookup-searchbutton").click()});b("#"+a.div).bind("dialogresize",c);d();a.v.change(d);a.f.find(".awf-lookup-clearbutton").click(function(b){j(b);a.v.val("").change();a.soc=true});a.f.find(".awf-lookup-openbutton").click(function(d){j(d);b("#"+a.div).dialog("open");a.soc&&n(a,"[]");a.soc=false;c()})},ajaxDropdown:function(a){function d(){h(a.d);b.get(a.url,g(a),function(c){a.d.empty();c=awf.readd(c);c!=null&&b.each(c,function(b,
c){var d="";c.S==true&&(d="selected = 'selected'");a.d.append("<option "+d+' value="'+c.V+'">'+c.T+"</option>")});a.d.change();a.v.data("notr","");a.v.trigger("awfready")}).complete(function(){i(a.d)}).error(function(){a.d.after(awf.errMsg())})}l(a);o(a,d);m(a,d);a.d.keyup(function(){b(this).change()}).change(function(){a.v.val()!=a.d.val()&&a.v.val(a.d.val()).change()})},readd:function(a){return(typeof a.d=="object"||typeof a.d=="string")&&a.d!=null?a.d:null},popup:function(a){draggable=true;if(a.fulls)a.res=
false;if(a.m||a.fulls)draggable=false;b("#"+a.i).dialog({draggable:draggable,width:a.fulls?b(window).width()-50:a.w,height:a.fulls?b(window).height()-50:a.h,title:a.title,modal:a.m,position:a.pos,resizable:a.res,buttons:a.btns,autoOpen:false});a.dntr||b("#"+a.i).bind("dialogclose",function(){b("#"+a.i).find("*").remove();b(this).remove()});b("#"+a.i).dialog("option",{dialogClass:"awf-fixed"});a.fulls&&s("#"+a.i)},multilookup:function(a){function d(){a.sel.html("");h(a.sel);var c=g(a,a);c.selected=
a.v.val();b.get(a.selectedUrl,c,function(c){c=awf.readd(c);c!=null&&b.each(c,function(b,c){a.sel.append("<li class='awf-list-item' data-val='"+c.K+"'><button type='button' class='awf-lookup-movebtn'><span></span></button>"+c.C+" </li>")})}).complete(function(){i(a.sel)}).error(function(){a.sel.parent().append(awf.errMsg())})}function c(){var c=a.div,d=b("#"+c).height()-(b("#"+c+" .awf-search").outerHeight(true)+p("#"+c+" .awf-lookup-searchlist")+p("#"+c+" .awf-lookup-selectedlist")+10);b("#"+c+" .awf-list").css("height",
d*0.5+"px")}function f(){return JSON.stringify(a.sel.find("li").map(function(){return b(this).data("val")}).get())}function e(){var c=a.d.empty(),d=a.v.val();if(d){h(c.parent());var e=g(a,a);e.v=d;b.get(a.getMultipleUrl,e,function(a){a=awf.readd(a);a!=null&&b.each(a,function(a,b){c.append("<li>"+b.C+"</li>")})}).complete(function(){i(c.parent())}).error(function(){c.parent().append(awf.errMsg())})}}l(a);a.div=a.i+"-awfpw";a.soc=true;a.fv=true;m(a,function(){a.soc=true});awf.popup({i:a.div,w:a.w,h:a.h,
fulls:a.fulls,pos:"center",res:false,title:a.title,m:a.m,dntr:1,btns:[{text:a.ok,click:function(){a.v.val(f()).change();b(this).dialog("close")}},{text:a.cancel,click:function(){b(this).dialog("close")}}]});a.srl=b("#"+a.div+" .awf-lookup-searchlist ul");a.sel=b("#"+a.div+" .awf-lookup-selectedlist ul");a.srl.delegate(".awf-lookup-movebtn","click",function(){b(this).closest(".awf-list-item").prependTo(a.sel)});a.sel.delegate(".awf-lookup-movebtn","click",function(){b(this).closest(".awf-list-item").prependTo(a.srl)});
b('<button type="button" class="awf-lookup-searchbutton" >'+a.st+"</button>").click(function(){n(a,f())}).appendTo("#"+a.div+" .awf-search");b('<input type="text" name="search"/>').prependTo("#"+a.div+" .awf-search").keyup(function(c){c.which=="13"&&b("#"+a.div).find(".awf-lookup-searchbutton").click()});b("#"+a.div).bind("dialogresize",c);a.v.change(e);e();a.f.find(".awf-lookup-clearbutton").click(function(b){j(b);a.v.val("").change();a.fv=true;a.soc=true});a.f.find(".awf-lookup-openbutton").click(function(e){j(e);
b("#"+a.div).dialog("open");a.soc&&n(a,a.v.val());a.fv&&d();a.soc=false;a.fv=false;c()})}}}();
